// pages/charge_record/charge_record.js
var reqHelp = require('../../utils/reqHelp.js');
const app = getApp()
Page({

    /**
     * 页面的初始数据
     */
    data: {
        tabId:1,
        serviceId:1,
        chargeList:[],
        pageIndex:0,
        loadMsg:'',
    },
    onLoad(options){
        var cardId = options.cardId;
        this.selectComponent("#loading").show()
        this.setData({
          cardId: cardId
        });
        this.onList();
    },
    onReachBottom() {
        this.onList();
    },
    onList(){
       
        let that = this;
        const{cardId }= this.data;
        reqHelp.requestByJson(app.globalData.apiUrlNew+'Mini/BalUpdated.ashx?action=listCharge', {
          cardId: cardId
        }).then(function (res) {
          console.log(res)
          if (res.getNum == 0) {
              that.setData({
                chargeList: res.dtCharge, 
                objCard: res.objCard 
              });
          }
        });
        this.selectComponent("#loading").hide()
    }
})